<style>
   .widgets_goods_show_setting .inputstyle{width:50px;}
   .widgets_goods_show_setting .clearfix{overflow:hidden;height:100%;}
   .widgets_goods_show_setting .span-auto{width:30%;float:left;border:1px #ccc dotted;padding:3px;height:130px;margin:1px;}
   .widgets_goods_show_setting .checked{background:#efefef;border-style:solid;}
   .widgets_goods_show_setting i{display:block;}
</style>
<div id='goods-show-config'>
<div class="division">
  <h4><{t app='b2c'}>范围设置<{/t}></h4>
    <{assign var=g_filter value=$setting.adjunct.items.0}>
<{input type="goodsfilter" app=b2c name="g_filter" value=array('items'=>$g_filter)}>
</div>
<div class="division widgets_goods_show_setting">
  <h4><{t app='b2c'}>排列方式设置<{/t}></h4>
    <table width="100%" cellpadding="0" cellspacing="0">
      <tr>
        <th><{t app='b2c'}>显示商品数：<{/t}></th>
        <td><{input name="limit" value=$setting.limit|default:'4' required="true" type="digits" class='inputstyle'}></td>
        <th><{t app='b2c'}>每行显示商品数：<{/t}></th>
        <td><{input name="column" value=$setting.column|default:'4' required="true" type="digits" class='inputstyle'}></td>
        <th><{t app='b2c'}>排序设定：<{/t}></th>
        <td><select name="goods_orderby">
		<{foreach from=$data item=orderby key=key}>
		<option value="<{$key}>" <{if $setting.goods_orderby==$key}>selected<{/if}>><{$orderby.label}></option>
		<{/foreach}>
		</select>
		</td>
      </tr>
    </table>
</div>
<div class="division widgets_goods_show_setting">
  <h4><{t app='b2c'}>显示设置<{/t}></h4>
  <div class='clearfix'>
      <div class='span-auto'>
       <label><{t app='b2c'}>商品图片<{/t}><input type='checkbox' name='showGoodsImg' value='<{$setting.showGoodsImg}>'/></label>
<div class='note'>
         <{t app='b2c'}> 强制宽高：<{/t}><br/>
          <{input name="goodsImgWidth" value=$setting.goodsImgWidth type="digits" class='inputstyle'}><{t app='b2c'}>(宽)X(高)<{/t}><{input name="goodsImgHeight" value=$setting.goodsImgHeight type="digits" class='inputstyle'}><br/>
         <{* 启用即时放大：<input type='radio' name='zoomhandleable' value='on' <{if $setting.zoomhandleable!="off"}>checked=true<{/if}> />是 <input type='radio' name='zoomhandleable' value='off' <{if $setting.zoomhandleable=="off"}>checked=true<{/if}>/>否*}>
</div>
      </div>
      <div class='span-auto'>
       <label><{t app='b2c'}>商品名称<{/t}><input type='checkbox' name='showGoodsName' value='<{$setting.showGoodsName}>'/></label>
       <div class='note'>
      <{t app='b2c'}> 最多显示<{/t}><{input name="gname_row_max_length" class='inputstyle' value=$setting.gname_row_max_length|default:'1'}><{t app='b2c'}>行<{/t}><br/>
      <{t app='b2c'}> 行高<{/t}><{input name="gname_row_lh" class='inputstyle' value=$setting.gname_row_lh|default:'18'}>px<br/>
      <{t app='b2c'}> 超过<{/t}><{input name="gname_max_length" class='inputstyle' value=$setting.gname_max_length|default:'50'}><{t app='b2c'}>个字符截断<{/t}><br/>
       </div>
      </div>
      <div class='span-auto'>
       <label><{t app='b2c'}>市场价<{/t}><input type='checkbox' name='showGoodsMktPrice' value='<{$setting.showGoodsMktPrice}>'/></label>


         <div class='note'>
           <i><{t app='b2c'}>显示效果：<{/t}></i>
             <input name="mktPriceText" class="inputstyle" value="<{$setting.mktPriceText|default:$arg}>">
             <input name="mktPriceSep" class="inputstyle" value="<{$setting.mktPriceSep|default:':'}>"><{t app='b2c'}>{价格}<{/t}>
         </div>

      </div>
       <div class='span-auto'>
       <label><{t app='b2c'}>销售价<{/t}><input type='checkbox' name='showGoodsPrice' value='<{$setting.showGoodsPrice}>'/></label>
         <div class='note'>
         <i><{t app='b2c'}>显示效果：<{/t}></i>
         <{assign var=arg1 value=$___b2c='销售价'|t:'b2c'}>
             <input name="priceText" class="inputstyle" value="<{$setting.priceText|default:$arg1}>">
             <input name="priceSep" class="inputstyle" value="<{$setting.priceSep|default:':'}>"><{t app='b2c'}>{价格}<{/t}>
         </div>
      </div>
      <div class='span-auto'>
       <label><{t app='b2c'}>节省<{/t}><input type='checkbox' name='showGoodsSave' value='<{$setting.showGoodsSave}>'/></label>


         <div class='note'>
         <i><{t app='b2c'}>显示效果：<{/t}></i>
         <{assign var=arg2 value=$___b2c='节省'|t:'b2c'}>
             <input name="saveText" class="inputstyle" value="<{$setting.saveText|default:$arg2}>">
             <input name="saveSep" class="inputstyle" value="<{$setting.saveSep|default:':'}>"><{t app='b2c'}>{价格}<{/t}>
         </div>

      </div>
      <div class='span-auto'>
       <label><{t app='b2c'}>折扣<{/t}><input type='checkbox' name='showCount' value='<{$setting.showCount}>'/></label>


         <div class='note'>
           <i><{t app='b2c'}>显示效果：<{/t}></i>
           <{assign var=arg2 value=$___b2c='折扣：'|t:'b2c'}>
             <input name="countText" class="inputstyle" value="<{$setting.countText|default:$arg2}>">
             <{t app='b2c'}>{折扣率}<{/t}><input name="countSep" class="inputstyle" value="<{$setting.countSep|default:'%'}>">
         </div>
      </div>
      <div class='span-auto'>
       <label><{t app='b2c'}>商品描述<{/t}><input type='checkbox' name='showGoodsDesc' value='<{$setting.showGoodsDesc}>'/></label>
       <div class='note'>
         <{t app='b2c'}>最多显示<{/t}><{input name="gdesc_row_max_length" class='inputstyle' value=$setting.gdesc_row_max_length|default:'2'}><{t app='b2c'}>行<{/t}><br/>
         <{t app='b2c'}>行高<{/t}><{input name="gdesc_row_lh" class='inputstyle' value=$setting.gdesc_row_lh|default:'18'}>px<br/>
         <{t app='b2c'}>超过<{/t}><{input name="desc_max_length" value=$setting.desc_max_length|default:'200' class='inputstyle'}><{t app='b2c'}>个字符截断<{/t}>
       </div>
      </div>
      <div class='span-auto'><label><{t app='b2c'}>在列表最后显示“更多...”连接<{/t}><input type='checkbox' name='showMore' value='<{$setting.showMore}>'/></label>


      </div>

  </div>
</div>
</div>
<script>
   void function(){

   var defaultOn = ['GoodsImg','GoodsName','GoodsMktPrice','GoodsPrice'];

   $$('#goods-show-config .span-auto label input[type=checkbox]').each(function(item){

       item.addEvents({
            'click':function(){
                this.getParent('.span-auto')[this.checked?'addClass':'removeClass']('checked');
                if(!this.checked){
                   if(!this.getNext('input[type=hidden]')) new Element('input',{type:'hidden',name:this.name,value:'off'}).injectAfter(this);
                }else{
                   if(this.getNext('input[type=hidden]')) this.getNext('input[type=hidden]').destroy();
                }
            },
            'change':function(){

               this.value = this.checked?'on':'off';

            }

       });

       if((item.value.trim()=='') && defaultOn.contains(item.name.slice(4))){
           item.value ='on';
       }
       item.checked = (item.value=='on')?true:false;
       item.fireEvent('click');

   });

   }();

</script>